
package com.craterhill.java.ems.dao;

import java.sql.ResultSet;
import java.sql.SQLException;

import com.craterhill.java.ems.common.beans.SchoolType;
import com.craterhill.java.ems.dao.utils.EMSResultSetExtractor;

public interface SchoolTypeDao extends EMSDao<SchoolType> {

	public final String FIELD_LIST = "obj.school_type_id, obj.school_type";

	public final String FIND_ALL = "select " + FIELD_LIST + " from school_type obj";

	public final class SchoolTypeExtractor extends EMSResultSetExtractor<SchoolType> {

		@Override
		protected SchoolType extractResultSetData(ResultSet resultSet) throws SQLException {
			SchoolType schoolType = new SchoolType();
			schoolType.setSchoolTypeId(resultSet.getInt(1));
			schoolType.setSchoolType(resultSet.getString(2));
			return schoolType;
		}
	}
}
